assert_that(p.cargo_process("build"),
execs()
.with_stderr("\
+[COMPILING] foo [..]
src[..]foo.rs:1:14: 1:26 warning: function is never used: `dead`, \
#[warn(dead_code)] on by default
src[..]foo.rs:1 fn main() {} fn dead() {}
"#);
assert_that(p.cargo_process("build"),
- execs()
- .with_stderr(&format!("[COMPILING] bar v0.5.0 ({}/bar)\n\
- [COMPILING] foo v0.5.0 ({})\n",
- p.url(),
- p.url()))
- .with_stderr("\
+ execs().with_stderr(&format!("\
+[COMPILING] bar v0.5.0 ({url}/bar)
[..]warning: function is never used: `dead`[..]
-[..]fn dead() {}
+[..]fn dead() {{}}
[..]^~~~~~~~~~~~
-"));
+[COMPILING] foo v0.5.0 ({url})
+", url = p.url())));
assert_that(&p.bin("foo"), existing_file());
execs().with_status(0)
.with_stderr("\
warning: unused manifest key: project.bulid
+[COMPILING] foo [..]
"));
let mut p = project("bar");
execs().with_status(0)
.with_stderr("\
warning: unused manifest key: lib.build
+[COMPILING] foo [..]
"));
});
[COMPILING] foo v0.5.0 ({url})
[RUNNING] `rustc build.rs --crate-name build_script_build --crate-type bin [..]`
[RUNNING] `[..]build-script-build[..]`
-",
-url = p.url()))
- .with_stderr(&format!("\
-[ERROR] failed to run custom build command for `foo v0.5.0 ({})`
+[ERROR] failed to run custom build command for `foo v0.5.0 ({url})`
Process didn't exit successfully: `[..]build[..]build-script-build[..]` \
(exit code: 101)",
-p.url())));
+url = p.url())));
});
test!(custom_build_env_vars {
assert_that(p.cargo_process("build"),
execs().with_status(101)
- .with_stderr(&format!("\
+ .with_stderr_contains(&format!("\
[ERROR] Only `-l` and `-L` flags are allowed in build script of `foo v0.5.0 ({})`: \
`-aaa -bbb`",
p.url())));
assert_that(p.cargo_process("build").arg("-v").arg("--target").arg(&target),
execs().with_status(101)
- .with_stderr("\
+ .with_stderr_contains("\
[..]lib.rs[..] error: can't find crate for `aaaaa`[..]
[..]lib.rs[..] extern crate aaaaa;
[..] ^~~~~~~~~~~~~~~~~~~
"#);
assert_that(p.cargo_process("build").arg("-v"),
execs().with_status(101)
- .with_stderr("\
+ .with_stderr_contains("\
[COMPILING] foo v0.5.0 (file://[..])
[RUNNING] `rustc build.rs [..]`
[RUNNING] `[..]foo-[..]build-script-build[..]`
[RUNNING] `rustc [..] --crate-name foo [..] -L foo -l static=foo`
+[ERROR] could not find native static library [..]
+[ERROR] Could not compile [..]
"));
});
"#);
assert_that(p.cargo_process("build").arg("-v"),
execs().with_status(101)
- .with_stderr("\
+ .with_stderr_contains("\
[COMPILING] foo v0.5.0 (file://[..])
[RUNNING] `rustc build.rs [..]`
[RUNNING] `[..]foo-[..]build-script-build[..]`
[RUNNING] `rustc [..] --crate-name foo [..] -L foo -l static=foo`
+[ERROR] could not find native static library [..]
+[ERROR] Could not compile [..]
"));
});